package org.ljy.rabbitmqspringboot.listener;

import org.ljy.rabbitmqspringboot.contant.Constants;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;
//路由模式-消费者

@Component
public class DirectListener {

    @RabbitListener(queues = Constants.DIRECT_QUEUE1)
    public void directQueue1(String message) {
        System.out.println("direct 1["+ Constants.DIRECT_QUEUE1 +"]收到消息:" + message);
    }

    @RabbitListener(queues = Constants.DIRECT_QUEUE2)
    public void directQueue2(String message) {
        System.out.println("direct 1["+ Constants.DIRECT_QUEUE2 +"]收到消息:" + message);
    }
}
